package com.frame.ar.vo;

/*******************************************
 * 作用描述：AJAX操作返回参数
 *******************************************
 * @author LRC
 * @createDate 2015-9-13
 * @version v1.0 
 * @updateRecord 格式：时间，作者，修改说明
 *******************************************
 * 
 */
public class AjaxDone {
	public static final String OK="200";//成功
	public static final String ERROR="300";//失败
	public static final String TIMEOUT="301";//超时
	/**
	 * 操作结果
	 */
	private String statusCode;
	/**
	 * 返回消息
	 */
	private String message;
	/**
	 * tabid
	 */
	private String tabid;
	/**
	 * 是否关闭当前窗口
	 */
	private Boolean closeCurrent = false;
	/**
	 * 跳转刷新页签
	 */
	private String forward;
	/**
	 * 跳转确认刷新页签
	 */
	private String forwardConfirm;
	
	/**
	 * 返回的补充数据
	 */
	private String data;
	
	public AjaxDone(){
		statusCode = ERROR;//默认失败
	}
	
	public AjaxDone(String code,String msg){
		this.statusCode = code;
		this.message = msg;
	}
	
	public String getStatusCode() {
		return statusCode;
	}
	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}
	public String getMessage() {
		if(message==null){
			switch(statusCode){
				case OK:message="操作成功！";break;
				case ERROR:message="操作失败！";break;
				case TIMEOUT:message="请求超时！";break;
			}
		}
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public String getTabid() {
		return tabid;
	}
	public void setTabid(String tabid) {
		this.tabid = tabid;
	}
	public Boolean getCloseCurrent() {
		return closeCurrent;
	}
	public void setCloseCurrent(Boolean closeCurrent) {
		this.closeCurrent = closeCurrent;
	}
	public String getForward() {
		return forward;
	}
	public void setForward(String forward) {
		this.forward = forward;
	}
	public String getForwardConfirm() {
		return forwardConfirm;
	}
	public void setForwardConfirm(String forwardConfirm) {
		this.forwardConfirm = forwardConfirm;
	}
	public String getData() {
		return data;
	}
	public void setData(String data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "AjaxDone [statusCode=" + statusCode + ", message=" + message
				+ ", tabid=" + tabid + ", closeCurrent=" + closeCurrent
				+ ", forward=" + forward + ", forwardConfirm=" + forwardConfirm
				+ ", data=" + data + "]";
	}
}
